fix(test): widen timeouts on real-git miner clone/worktree tests - #6869
Merged
Conversation
The #5132 miner clone/worktree suite (test/unit/miner-attempt-worktree.test.ts, test/unit/miner-repo-clone.test.ts) runs 4-10 real, sequential git subprocess spawns per test to exercise genuine clone/fetch/checkout/reset/worktree-add behavior. Under concurrent full-suite load this reliably exceeds the default 15s test timeout on the heaviest tests -- not a logic failure: isolated runs pass in well under 1s, and 5x repeated runs under simulated CPU contention (16 processes oversubscribing a 12-core machine) all passed. Widens every real-git test in both files to an explicit 60s, matching the existing convention used for this same class of test in test/unit/agent-sdk-driver.test.ts.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6869 +/- ##
=======================================
Coverage 93.64% 93.64%
=======================================
Files 685 685
Lines 68238 68238
Branches 18707 18707
=======================================
Hits 63903 63903
Misses 3350 3350
Partials 985 985
Flags with carried forward coverage won't be shown. Click here to find out more. |
This was referenced Jul 17, 2026
JSONbored
added a commit
that referenced
this pull request
Jul 25, 2026
* fix(deps): resolve postcss + tar audit findings via overrides npm audit flagged postcss <=8.5.17 (path traversal in previous-sourcemap auto-loading, GHSA-r28c-9q8g-f849, high) and tar <=7.5.20 (uncontrolled recursion DoS via crafted long-path tar, GHSA-r292-9mhp-454m, moderate), both transitive. Pin both via overrides, matching this file's existing pattern for other transitive-dep security fixes: bump the existing tar override past its first-patched version (7.5.19 -> 7.5.21) and add a new postcss override (8.5.18, first patched version). Closes task 1 of #8588's checklist. The remaining findings in that issue (eslint v10 bump for the brace-expansion/minimatch chain, the @esbuild-kit->tsx trace, and the recharts v3 migration) are unrelated, each need their own scoping, and are now tracked as sub-issues #8608, #8609, #8610. * build: add the missing ui-kit build step to the local test:ci gate Discovered incidentally while running the full local gate for #8588: test/unit/check-ui-kit-package.test.ts's own regression guard needs packages/loopover-ui-kit/dist/ to exist, but the root test:ci script never built that workspace before test:coverage -- unlike the real CI validate-tests job, which already builds it via `npx turbo run build --filter=@loopover/ui-kit` right before its own coverage step (added in #8592 to close this exact gap, but only in the CI workflow, not the local script this repo's own contributing guide points everyone at). Anyone running `npm run test:ci` from a clean checkout hit a spurious failure that real CI never showed. Adds `npm run build --workspace @loopover/ui-kit` alongside the other per-package builds already in the chain (engine, discovery-index, mcp, miner), so the local script matches CI again. * fix(mcp): stop CLI stdout truncation on >64KB piped output Discovered incidentally while running the full local gate for #8588: test/unit/mcp-cli-profiles.test.ts's changelog test started failing with a JSON parse error once packages/loopover-mcp/CHANGELOG.md grew past the OS pipe buffer size (verified: `loopover-mcp changelog --json | wc -c` returned exactly 65536 bytes instead of the real 65603+ -- the classic 64KB pipe-buffer boundary). Root cause: process.stdout/stderr writes to a POSIX pipe are asynchronous, but the CLI entrypoint called process.exit() immediately after the command's async work resolved, cutting off any pending write larger than one pipe buffer's worth before it finished flushing. This silently truncates any command's output over ~64KB for any real consumer piping the CLI (not just this test) -- e.g. `loopover-mcp changelog --json | jq` would get invalid JSON. Fix: drain both streams (wait for their internal buffer to empty) right before calling process.exit(), instead of changing when/whether process.exit() itself is called -- keeps the existing fast-exit behavior for everything else (no risk of hanging on a lingering fetch keep-alive socket) while fixing the truncation at its actual source. * test(miner): raise timeout for build:verify syntax-check regression guard Discovered incidentally while running the full local gate for #8588: this test spawns a real subprocess (node --check over every dist/bin+dist/lib file in packages/loopover-miner) -- 5.5s in isolation, but it exceeded the default 15s testTimeout once under the full suite's parallel load. Genuinely necessary real subprocess work with no redundancy to cut, matching this repo's established real-subprocess timeout-flake pattern (agent-sdk-driver.test.ts, miner-attempt-worktree .test.ts, miner-repo-clone.test.ts, #6869/#6871): raise to the same evidence-based 60000ms ceiling already used for that class of test, rather than reflexively widening without a reason.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test/unit/miner-attempt-worktree.test.tsandtest/unit/miner-repo-clone.test.ts(the#5132miner clone/worktree suite) run 4-10 real, sequentialgitsubprocess spawns per test (init/add/commit an origin repo, then clone/fetch/checkout/reset/worktree addagainst it) to exercise genuine behavior rather than mocks.60000ms timeout, matching the existing convention already used for this same class of test intest/unit/agent-sdk-driver.test.ts(a real-git-subprocess test hardened the same way).test/unit/ai-summaries.test.ts, separate PR) -- running the full suite to verify that fix surfaced these two files' pre-existing flakiness too.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally -- test-only change totest/**, which Codecov does not measure, so there is no patch-coverage obligation.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateAdditional validation beyond the standard checklist: both files' own tests were run 5x under simulated heavy CPU contention (16 CPU-bound processes oversubscribing a 12-core machine) with zero outright failures. A full local
npm run test:cirun also passed both fixed files cleanly (miner-repo-clone.test.tsandminer-attempt-worktree.test.tsboth green), though that run also surfaced two additional, unrelated flakes (test/unit/github-labels.test.ts,test/unit/github-pr-actions.test.ts) that only appeared while two full 18k-test suites were running concurrently on the same machine -- self-inflicted, unrealistic contention well beyond normal CI conditions, not something observed under a single full-suite run. Flagging separately rather than expanding this PR's scope further.Safety
UI Evidencesection below. (Not applicable -- no visible/UI changes.)UI Evidence
Not applicable -- test-only change, no UI/frontend/docs surface touched.
Notes
test/unit/ai-summaries.test.tsflake, and a same-pattern fix fortest/unit/agent-sdk-driver.test.tsdiscovered along the way.